package com.wangzd.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author wangzd
 * @date 2020/12/31 17:08
 */
@Configuration
public class ApplicationConfig {

    @Bean
    @LoadBalanced // 使用 `@LoadBalanced` 注解赋予RestTemplate 负载均衡能力
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
